#include<vector>
using namespace std;

class Solution {
public:
    vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies) {
        int maxValue = 0;
        for (int i = 0; i < candies.size(); ++i) {
            if (candies[i] > maxValue)
                maxValue = candies[i];
        }
        maxValue -= extraCandies;
        vector<bool> res(candies.size());
        for (int i = 0; i < candies.size(); ++i) {
            res[i] = candies[i] >= maxValue;
        }
        return res;

    }
};